/* OUTPUT TO c:\qadguicli\trcst_comp.xls. */
DEFINE BUFFER C FOR sct_det.    
DEFINE BUFFER S FOR sct_det.    
        

FOR EACH C WHERE c.sct_sim = "standard" AND c.sct_site = "510" AND c.sct_part BEGINS "18" NO-LOCK,
    EACH S WHERE s.sct_sim = "standard" AND s.sct_site = "500" AND s.sct_part = c.sct_part NO-LOCK, 
    EACH pt_mstr WHERE pt_part = s.sct_part NO-LOCK
    BREAK BY pt_part :

    IF ABS(S.sct_cst_tot - C.sct_cst_tot) > 0.0001 AND c.sct_cst_tot <> 0 THEN DO:
    
/*         FIND FIRST hsctd_det WHERE hsctd_part = s.sct_part NO-LOCK NO-ERROR. */
/*         IF NOT AVAILABLE hsctd_det THEN DO:                                  */
/*                                                                              */
/*             CREATE hsctd_det.                                                */
/*             ASSIGN hsctd_nbr     = "CJ480012".                               */
/*             ASSIGN hsctd_part    = c.sct_part.                               */
/*             ASSIGN hsctd_mat_cst = c.sct_cst_tot.                            */
/*         END.                                                                 */
       DISP c.sct_part
            pt_added
            pt_status
            pt_pm_code
            c.sct_mtl_tl FORMAT ">>>9.9<<<"
            c.sct_mtl_ll FORMAT ">>>9.9<<<"
            c.sct_lbr_tl FORMAT ">>>9.9<<<"
            c.sct_lbr_ll FORMAT ">>>9.9<<<"
            c.sct_bdn_tl FORMAT ">>>9.9<<<"
            c.sct_bdn_ll FORMAT ">>>9.9<<<"
            c.sct_cst_tot LABEL "510std" FORMAT ">>>9.9<<<"
            S.sct_cst_tot LABEL "500Std" FORMAT ">>>9.9<<<"
            s.sct_mtl_tl FORMAT ">>>9.9<<<"
            s.sct_mtl_ll FORMAT ">>>9.9<<<"
            s.sct_lbr_tl FORMAT ">>>9.9<<<"
            s.sct_lbr_ll FORMAT ">>>9.9<<<"
            s.sct_bdn_tl FORMAT ">>>9.9<<<"
            s.sct_bdn_ll FORMAT ">>>9.9<<<"


       WITH STREAM-IO WIDTH 320.
    END.
END.
